'''
Created on Mar 22, 2012
Description: Run all test cases
@author: Vu Dao
'''
import unittest
import HTMLTestRunner
import time
from TestCases.Ecom_5001 import Ecom_5001
from TestCases.Ecom_5002 import Ecom_5002
from TestCases.Ecom_5003 import Ecom_5003
from TestCases.Ecom_5004 import Ecom_5004
from TestCases.Ecom_5005 import Ecom_5005
from TestCases.Ecom_5006 import Ecom_5006
from TestCases.Ecom_5007 import Ecom_5007
from TestCases.Ecom_5008 import Ecom_5008
from TestCases.Ecom_5009 import Ecom_5009
from TestCases.Ecom_5010 import Ecom_5010
from TestCases.Ecom_5011 import Ecom_5011
from TestCases.Ecom_5012 import Ecom_5012
from TestCases.Ecom_5013 import Ecom_5013
from TestCases.Ecom_5014 import Ecom_5014
from TestCases.Ecom_5015 import Ecom_5015
from TestCases.Ecom_5016 import Ecom_5016
from TestCases.Ecom_5017 import Ecom_5017
from TestCases.Ecom_5018 import Ecom_5018
from TestCases.Ecom_5019 import Ecom_5019
from TestCases.Ecom_5020 import Ecom_5020
from TestCases.Ecom_5021 import Ecom_5021
from TestCases.Ecom_5022 import Ecom_5022
from TestCases.Ecom_5023 import Ecom_5023
from TestCases.Ecom_5024 import Ecom_5024
from TestCases.Ecom_5025 import Ecom_5025
from TestCases.Ecom_5026 import Ecom_5026
from TestCases.Ecom_5027 import Ecom_5027
from TestCases.Ecom_5028 import Ecom_5028
from TestCases.Ecom_5029 import Ecom_5029
from TestCases.Ecom_5030 import Ecom_5030
from TestCases.Ecom_5031 import Ecom_5031
from TestCases.Ecom_5032 import Ecom_5032
from TestCases.Ecom_5033 import Ecom_5033
from TestCases.Ecom_5034 import Ecom_5034
from TestCases.Ecom_5038 import Ecom_5038
from TestCases.Ecom_5039 import Ecom_5039
from TestCases.Ecom_5040 import Ecom_5040
from TestCases.Ecom_5043 import Ecom_5043
from TestCases.Ecom_5044 import Ecom_5044
from TestCases.Ecom_5045 import Ecom_5045
from TestCases.Ecom_5046 import Ecom_5046



if __name__ == "__main__":
#    unittest.main()
    suite = unittest.TestSuite()
    suite.addTests([
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5001),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5002),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5004),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5003),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5005),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5007),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5008),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5006),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5009),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5010),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5012),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5011),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5013),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5014),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5016),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5015),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5017),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5019),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5018),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5020),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5022),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5024),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5025),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5026),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5021),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5027),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5029),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5028),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5031),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5032),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5033),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5034),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5038),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5039),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5040),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5043),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5044),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5045),
        unittest.defaultTestLoader.loadTestsFromTestCase(Ecom_5046),
    ])
    dateTime = time.strftime('%Y%m%d_%H_%M_%S')
    buf = file("../../Report/TestResults" + "_" + dateTime + ".html",'wb')
    runner = HTMLTestRunner.HTMLTestRunner(
                stream=buf,
                title='Test Results',
                description='All test cases'
                )
    runner.run(suite)
    